namespace CompanyManageSystem.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.AToken",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        AppID = c.String(),
                        AppSecret = c.String(),
                        AccessToken = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.BaseElement",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        ParentID = c.Guid(),
                        Code = c.String(),
                        Category = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.BusinessNav",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        ParentID = c.Guid(),
                        WinName = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Company",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        CName = c.String(),
                        IsEnabled = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.CompanyStaffInfo",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        FName = c.String(),
                        Post = c.String(),
                        Wage = c.String(),
                        CompanyID = c.Guid(nullable: false),
                        EnterTime = c.DateTime(nullable: false),
                        ProvinceID = c.Guid(nullable: false),
                        Graduation = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Department",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        ParentID = c.Guid(),
                        Code = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Graduation",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        ParentID = c.Guid(),
                        Code = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Login",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        UserName = c.String(),
                        Password = c.String(),
                        IsRemembered = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Manager",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        Password = c.String(),
                        Photo = c.Binary(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Province",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Code = c.String(),
                        Name = c.String(),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Supplier",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        Name = c.String(),
                        Address = c.String(),
                        Phone = c.String(),
                        Code = c.String(),
                        Contracts = c.String(),
                        EnterTime = c.DateTime(nullable: false),
                        CategoryID = c.Guid(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.Users",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        UName = c.String(),
                        DepartmentID = c.Guid(nullable: false),
                        TrueName = c.String(),
                        IsEnabled = c.Boolean(nullable: false),
                        EnterTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
            CreateTable(
                "dbo.WeiXinInfo",
                c => new
                    {
                        ID = c.Guid(nullable: false),
                        ManagerID = c.Guid(nullable: false),
                        ManagerName = c.String(),
                        Info = c.String(),
                        SendTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.ID);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.WeiXinInfo");
            DropTable("dbo.Users");
            DropTable("dbo.Supplier");
            DropTable("dbo.Province");
            DropTable("dbo.Manager");
            DropTable("dbo.Login");
            DropTable("dbo.Graduation");
            DropTable("dbo.Department");
            DropTable("dbo.CompanyStaffInfo");
            DropTable("dbo.Company");
            DropTable("dbo.BusinessNav");
            DropTable("dbo.BaseElement");
            DropTable("dbo.AToken");
        }
    }
}
